<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head th:replace="/layout :: htmlhead" th:with="title='后台管理'">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <!--<div class="layui-card-header">-->
                <!--</div>-->
                <div class="layui-card-body">
                    <table class="layui-hide" id="table" lay-filter="table"></table>

                    <script type="text/html" id="islock">
                        {{#  if(d.status == 1){ }}
                        <input type="checkbox" name="{{d.name}}" value="{{d.id}}" lay-skin="switch"
                               lay-text="启用|停用"
                               lay-filter="islock" checked="checked"/>
                        {{#  } else { }}
                        <input type="checkbox" name="{{d.name}}" value="{{d.id}}" lay-skin="switch"
                               lay-text="启用|停用"
                               lay-filter="islock"/>
                        {{#  } }}
                    </script>

                    <script type="text/html" id="table-title">
                        <h2><b>角色列表</b>&nbsp;&nbsp;&nbsp;<a class="layui-btn layui-btn-normal layui-btn-xs"
                                                            onclick="openAdd()"
                                                            shiro:hasPermission="role:add">新建</a></h2>
                    </script>

                    <script type="text/html" id="table-toolbar">
                        <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="grant"
                           shiro:hasPermission="role:grant">授权</a>
                        <a class="layui-btn layui-btn-xs" lay-event="edit" shiro:hasPermission="role:edit">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                           shiro:hasPermission="role:del">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="roleEdit" class="layer_self_wrap" style="display:none;">
    <form id="roleForm" lay-filter="roleForm" class="layui-form layui-form-pane" method="post" style="margin-top: 20px;" action="">
        <input type="hidden" name="id"/>
        <input type="hidden" id="oper" >
        <div class="layui-form-item">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-inline">
                <input lay-verify="required"  name="name" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">角色排序</label>
            <div class="layui-input-inline">
                <input name="seq" lay-verify="number" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">角色描述</label>
            <div class="layui-input-inline">
                <input name="description" class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">角色类型</label>
            <div class="layui-input-inline">
                <select name="type">
                    <option value="1">系统管理</option>
                    <option value="2">业务管理</option>
                    <option value="3">审计管理</option>
                    <option value="4">安全管理</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item"style="float: right; margin-right: 100px;margin-top:50px">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submitUser" >确定</button>
                <button type="button" class="layui-btn layui-btn-primary"  onclick="submitCancel()" >取消</button>
            </div>
        </div>
    </form>
</div>
<div id="roleGrant" class="layer_self_wrap" style="display:none;">
    <input id="grantId" type="hidden">
    <div id="resourceTree"></div>
</div>

<script th:src="@{/js/systemManager/role.js}"></script>
</body>
</html>